package chpt_05_02_bridge;

import org.springframework.jdbc.core.JdbcTemplate;

/**
 * @author Ping
 * @date 2023/4/6 8:53
 **/
public class BridgePenDemo {
}

abstract class Pen {
    /**
     * 关联Color: 体现Bridge的含义
     */
    protected Color color ;
    JdbcTemplate template ;
    public abstract void draw(String content) ;

    public void setColor(Color color) {
        this.color = color;
    }
}


class LargePen extends Pen {
    @Override
    public void draw(String content) {
        this.color.pain(content + " : draw with LARGE PEN.");
    }
}

class SmallPen extends Pen {
    @Override
    public void draw(String content) {
        this.color.pain(content + " : draw with SMALL PEN.");
    }
}
/**
 * 实现部分：某维度
 */
interface Color {
    void pain(String content) ;
}

class Red implements Color {
    @Override
    public void pain(String content) {

    }
}

class Black implements Color {
    @Override
    public void pain(String content) {

    }
}


